using CampusModel.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CampusModel.Configuration;

public class CourseConfiguration : IEntityTypeConfiguration<Course>
{
    public void Configure(EntityTypeBuilder<Course> builder)
    {
        builder.HasKey(c => c.CourseID);
        builder.HasOne(c => c.Teacher).WithMany(t => t.Courses).HasForeignKey(c => c.TeacherID);
    }
}